import request from "./request";
import request_song from "./request_song";
import requests from "./mockAjaxk"
import request_mv from "./request_mv";
import search_album_mv from "./search_album_mv";

export const req_song = () => request({ url: '/v3/tag/list?pid=0&apiver=2&plat=0', method: 'get' });
//歌曲播放
export const req_song_info = (hash,ablumid,albumaudioid) => request_song({
    url: `/index.php?r=play/getdata&callback=jQuery19102566685754046343_1667398443959
    &hash=${hash}&dfid=3MnCVX0F3Eh83nq8Rj48921x&appid=1014
    &mid=7b80176e70467a362f3959310d084a1e&platid=4&
    album_id=${ablumid}&
    album_audio_id=${albumaudioid}&_=1667398443961`,
    method: 'get'
});
//mv播放
export const req_mv=(hash)=>request_mv({
    url:`/i/mv.php?cmd=100&hash=${hash}&ismp3=1&ext=mp4`,
    method:'get'
})
//歌手
export const req_singer = (sextype,sort,size,type) =>request({
    url:`/v5/singer/list?version=9108&showtype=1&plat=0&sextype=${sextype}&sort=${sort}&pagesize=${size}&type=${type}&page=1&musician=0`,
    method:'get'
});
//歌手资料
export const req_singer_info=(singerid)=>request({
    url:`/v3/singer/info?singerid=${singerid}&with_res_tag=1`,
    method:'get'
});
//歌手歌曲
export const req_singer_song=(identity,singerid)=>request({
    url:`/v3/singer/song?sorttype=2&version=9108&identity=${identity}&plat=0&pagesize=100&singerid=${singerid}&area_code=1&page=1&with_res_tag=1`,
    method:'get'
});
//歌手专辑
export const req_singer_album=(singerid)=>request({
    url:`/v3/singer/album?version=9108&plat=0&pagesize=36&singerid=${singerid}&category=1&area_code=1&page=1&show_album_tag=0`,
    method:'get'
});
//歌手mv
export const req_singer_mv=(singerid)=>request({
    url:`/v3/singer/mv?singername=%E9%A3%8E%E5%B0%8F%E7%AD%9D&pagesize=20&singerid=${singerid}&page=1&with_res_tag=1`,
    method:'get'
});
//专辑歌曲列表
export const req_album_song=(albumid)=>request({
    url:`/v3/album/song?version=9108&albumid=${albumid}&plat=0&pagesize=100&area_code=1&page=1&with_res_tag=1`,
    method:'get'
});

//mockjs 首页轮播图
export const banner = () => requests.get('/banner')
export const banner_1 = () => requests.get('/banner_1')
export const banner_2 = () => requests.get('/banner_2')

//热门歌单
export const req_hall_special=()=>request({
    url:`/v5/special/recommend?recommend_expire=0&sign=52186982747e1404d426fa3f2a1e8ee4&plat=0&uid=0&version=9108&page=1&area_code=1&appid=1005&mid=286974383886022203545511837994020015101&_t=1545746286`,
    method:'get'
})
//歌单歌曲列表
export const req_special_songList=(specialid)=>request({
    url:`/v5/special/song?specialid=${specialid}&version=9108&page=1&area_code=1`,
    method:'get'
})
//歌单分类详情
export const req_special_sort=(pid)=>request({
    url:`/v3/tag/list?pid=${pid}&apiver=2&plat=0`,
    method:'get'
})

export const req_special_list=(tagid,id)=>request({
    url:`/v3/tag/specialList?plat=0&page=1&tagid=${tagid}&pagesize=30&ugc=1&id=${id}&sort=1`,
    method:'get'
})

//搜索歌曲
export const search_song_list=(keyword)=>request({
    url:`/v3/search/song?showtype=14&highlight=em&pagesize=30&
    tag_aggr=1&tagtype=全部&plat=0&sver=5&keyword=${keyword}&correct=1&
    api_ver=1&version=9108&page=1&area_code=1&tag=1&with_res_tag=1`,
    method:'get'
})
//搜索歌单
export const search_special_list=(keyword)=>request({
    url:`/v3/search/special?
    version=9108&highlight=em&keyword=${keyword}&pagesize=20&
    filter=0&page=1&sver=2&with_res_tag=1`,
    method:'get'
})
//搜索专辑
export const search_album_list=(keyword)=>search_album_mv({
    url:`/search/album?version=9108&iscorrection=1&highlight=em&
    plat=0&keyword=${keyword}&pagesize=24&page=1&sver=2&
    with_res_tag=1`,
    method:'get'
})
//搜索mv
export const search_mv_list=(keyword)=>search_album_mv({
    url:`/search/mv?
    version=9108&highlight=em&keyword=${keyword}&
    pagesize=20&page=1&sver=2&with_res_tag=1`,
    method:'get'
})

//新歌
export const new_song_list=(pagesize,type,page)=>request({
    url:`/v3/rank/newsong?version=9108&plat=0&with_cover=1&pagesize=${pagesize}&type=${type}&area_code=1&page=${page}&with_res_tag=1`,
    method:'get'
})

//排行榜分类列表
export const rank_sort=()=>request({
    url:`/v3/rank/list?version=9108&plat=0&showtype=2&parentid=0&apiver=6&area_code=1&withsong=1&with_res_tag=1`,
    method:'get'
})
//排行榜详情列表
export const rank_sort_list=(type,size,page,cid,rankid)=>request({
    url:`/v3/rank/song?version=9108&ranktype=${type}&plat=0&pagesize=${size}&area_code=1&page=${page}&volid=${cid}&rankid=${rankid}&with_res_tag=1`,
    method:'get'
})